<?php
require_once("class.conexion.php");

class controller{
	private $module;
	private $action;
	private $controladorfile;
	private $classController;
	private $isContent;
	
	public $objetoControlador;
	
	public function __construct(){
		
		$this->module= $_REQUEST['module'];
		$this->action= $_REQUEST['action'];
		if($this->module == ''){
			include_once("contenido.php");
		}else{
			$this->mapaController();
			require_once($this->module."/".$this->controladorfile);
			$_REQUEST['action'] = $this->action;
			$this->objetoControlador = new $this->classController();
			$this->objetoControlador->action = $this->action;
		}
	}
	
	
	private function mapaController(){
		if($this->module == 'empleados'){
			$this->controladorfile= "class.controller_empleados.php";
			$this->classController="controller_empleados";
		}
		
		else if($this->module == 'eventos'){
			$this->controladorfile= "class.controlador.php";
			$this->classController="eventos_controlador";
		}
		else if($this->module == 'asignaciones'){
			$this->controladorfile= "class.controller.php";
			$this->classController="asignaciones_controller";
		}	
	}
}
?>